<script>
    $(function () {
        for (var i = 0; i <${partInspectionMsg.size()}; i++) {
            var name = 'td' + i;
            if ($("td[name='" + name + "']").html() == '' || $("td[name='" + name + "']").html() == null) {
                $("td[name='" + name + "']").css("backgroundColor", "#FF8888")
            } else {
                $("td[name='" + name + "']").css("backgroundColor", "#53FF53")
            }

        }
    })
</script>

<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch"
          action="${request.getContextPath()}/PartInspectionMsg/partInspectionMsg" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="partInspectionMsg"/>
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel"/>
            <label>客户：</label>
            %{--<g:select name="customerLotId" from="${customerLotIdList}" data-toggle="selectpicker" data-live-search="true"--}%
                      %{--optionKey="CUSTOMER_LOT_ID" optionValue="CUSTOMER_LOT_ID" value="${customerLotId}"--}%
                      %{--data-width="130" noSelection="['': '-- All --']"/>&nbsp;--}%
            <g:textField name="customerLotId" value="${customerLotId}" size="15" placeholder="客户" />&nbsp;
            <label>送检人工号：</label>
            <input type="text" name="checkinByName" value="${checkinByName}" size="10" placeholder="送检人工号"/>&nbsp;
        %{-- <g:select name="checkinByName" from="${partInspectionMsgCheckInByName}" data-toggle="selectpicker" data-live-search="true" optionKey="checkin_by_name" optionValue="checkin_by_name" value="${checkinByName}" noSelection="['':'ALL']" />&nbsp;--}%
            <label>送检人：</label>
            <input type="text" name="checkinBy" value="${checkinBy}" size="15" placeholder="送检人"/>&nbsp;
        %{--<g:select name="checkinBy" from="${partInspectionMsgCheckInBy}" data-toggle="selectpicker" data-live-search="true" optionKey="checkin_by" optionValue="checkin_by" value="${checkinBy}" noSelection="['':'ALL']" />&nbsp;<br/>--}%
            <label>内部图号：</label>
            <input type="text" name="part" value="${part}" size="15" placeholder="内部图号"/>&nbsp;
        %{--<g:select name="part" from="${partInspectionMsgPartList}" data-toggle="selectpicker" data-live-search="true" optionKey="part" optionValue="part" value="${part}" noSelection="['':'ALL']" />&nbsp;--}%
            <label>批号：</label>
            <input type="text" name="lotId" value="${lotId}" size="17" placeholder="批号"/>
            <br/><br/>
            <label>是否合格：</label>
            <g:select name="isHege" from="${partInspectionMsgIsHege}" data-toggle="selectpicker" data-live-search="true"
                      optionKey="judge" optionValue="judge" value="${isHege}" data-width="130"
                      noSelection="['': '-- All --']"/>&nbsp;

            <label>产品分类：</label>
            <g:select name="cate" from="${partInspectionMsgCate}" data-toggle="selectpicker" data-live-search="true"
                      optionKey="category" optionValue="category" value="${cate}" data-width="130"
                      noSelection="['': '-- All --']"/>&nbsp;
            <label>工分类别：</label>
            <g:select name="gflb" from="${partInspectionMsgGFLB}" data-toggle="selectpicker" data-live-search="true"
                      optionKey="gongfenleibie" optionValue="gongfenleibie" value="${gflb}" data-width="130"
                      noSelection="['': '-- All --']"/>&nbsp;
            <label>检查结束时间：</label>
            <input type="text" name="start" value="${start}" data-pattern="yyyy-MM-dd HH:mm:ss" size="18"
                   data-toggle="datepicker" placeholder="FROM">
            <input type="text" name="end" value="${end}" data-pattern="yyyy-MM-dd HH:mm:ss" size="18"
                   data-toggle="datepicker" placeholder="TO">
            <br /><br />
            <label>检查工序：</label>
            <g:select name="stepDesc" from="${checkStepList}" data-toggle="selectpicker" data-live-search="true"
                      optionKey="step_name" optionValue="step_desc" value="${stepDesc}" data-width="130"
                      noSelection="['': '-- All --']"/>&nbsp;
            <label>检验员工号：</label>
            <input type="text" name="checkoutByName" value="${checkoutByName}" size="10" placeholder="检验员工号"/>&nbsp;
            <label>检验员：</label>
            <input type="text" name="checkoutBy" value="${checkoutBy}" size="15" placeholder="检验员"/>
            <label>送检时间<strong></strong>：</label>
            <input type="text" name="startTime" value="${startTime}" data-pattern="yyyy-MM-dd HH:mm:ss"
                   data-toggle="datepicker" size="18" placeholder="FROM">
            <input type="text" name="endTime" value="${endTime}" data-pattern="yyyy-MM-dd HH:mm:ss"
                   data-toggle="datepicker" size="18" placeholder="TO">
            <br /><br />
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
        %{--<button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/PartInspectionMsg/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;--}%
            <a type="button" class="btn btn-blue"
               href="${request.getContextPath()}/PartInspectionMsg/partInspectionMsg?export=xls"
               data-toggle="doexport" data-confirm-msg="确定要导出吗？" data-icon="sign-out">导出</a>
        </div>
    </form>
</div>

<div class="bjui-pageContent tableContent">
    <g:if test="${partInspectionMsg.size() > 0}">
        <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr>
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance != 'RN'}">
                        <th width="150"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:each in="${partInspectionMsg}" status="i" var="dataInstance">
                <tr>
                    <g:each in="${tableHeadList}" status="j" var="headInstance">
                        <g:if test="${headInstance != 'RN' && headInstance != 'NORMAL_OUTQTY'}">
                            <td>${dataInstance["${headInstance}"]}</td>
                        </g:if>
                        <g:elseif test="${headInstance == 'NORMAL_OUTQTY'}">
                            <td name="${'td' + i}">${dataInstance["${headInstance}"]}</td>
                        </g:elseif>
                    </g:each>
                </tr>
            </g:each>
            </tbody>
        </table>
    </g:if>
    <g:else>
        <g:render template="../template/emptyPanel"/>
    </g:else>
</div>
<g:render template="../template/51pagination"/>